﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace AGrandVenture
{
    class EvilEye : Enemy
    {
        private static string name = "Evil Eye";
        private static Texture2D texture = Game1.evilEyeSheet;
        private static Rectangle initialFrame = new Rectangle(0, 0, 48, 37);
        private static int hp = 60;
        private static int xpValue = 10;
        private static int damageDealt = 5;
        private static int damageTaken = 3;
        private static float rangedAttackMinCooldown = 5f;
        private static float moveSpeed = 80f;
        private static float lootChance = 0.99f;
        private float rangedAttackCooldown = 0f;

        public EvilEye(Vector2 worldLocation)
            : base(name, worldLocation, texture, initialFrame)
        {
            //Walk frame
            base.EnemyBase.AddFrame(new Rectangle(0, 0, 48, 37), 0.3f);
            base.EnemyBase.AddFrame(new Rectangle(48, 0, 48, 37), 0.3f);

            base.HasClaws = false;
            base.NeedsToFlip = true;
            base.NeedsToRotate = false;
            base.HasRangedAttack = true;
            base.MaxAttackRange = 500;
            base.MoveSpeed = moveSpeed;
            base.ChanceToDropLoot = lootChance;
            base.DamageDealt = damageDealt;
            base.DamageTaken = damageTaken;
            base.HP = hp;
            base.XP_Value = xpValue;
            base.Level = 1;

        }

        public override void performRangedAttack()
        {
            base.CurrentlyAttacking = true;
            base.EnemyBase.ClearFrames();
            base.MoveSpeed = 0f;
            base.EnemyBase.AddFrame(new Rectangle(96, 0, 48, 37), 0.1f);
            base.EnemyBase.AddFrame(new Rectangle(0, 37, 48, 37), 0.2f);
            base.EnemyBase.AddFrame(new Rectangle(48, 37, 48, 37), 0.3f);
            base.EnemyBase.AddFrame(new Rectangle(96, 37, 48, 37), 0.5f);
            //WeaponManager.FireWeapon(this.WorldLocation 
        }

        public override void endOfAttack()
        {
            base.CurrentlyAttacking = false;
            base.MoveSpeed = moveSpeed;

            base.EnemyBase.ClearFrames();
            base.EnemyBase.AddFrame(new Rectangle(0, 0, 48, 37), 0.3f);
            base.EnemyBase.AddFrame(new Rectangle(48, 0, 48, 37), 0.3f);
        }
    }
}
